import request from "../request.js"

// 获取全部收货地址
function requestAllAddress(data){
	return request({
		url:`/lejuClient/address/findAllAddress`,
		data
	})
}



// 新增收货地址
function requestAddAddress(data){
	return request({
		method:'post',
		url:`/lejuClient/address/addAddressInfo`,
		data
	})
}


// 删除收货地址
function requestRemoveAddress(addressId){
	return request({
		method:'delete',
		url:`/lejuClient/address/delAddressInfo/${addressId}`,
	})
}

// 更新地址
function requestUpdataAddress(data){
	return request({
		method:'post',
		url:`/lejuClient/address/updateAddressInfo`,
		data
	})
}

// 设置地址默认
function requestDefaultAddress(addressId,defaultStatus){
	return request({
		method:'post',
		url:`/lejuClient/address/switchDefault/${addressId}/${defaultStatus}`,
	})
}



export {
	requestAllAddress,
	requestAddAddress,
	requestRemoveAddress,
	requestDefaultAddress,
	requestUpdataAddress
}